/*
 * @Author: hmhvictory 1400628624@qq.com
 * @Date: 2025-08-01 15:57:01
 * @LastEditors: hmhvictory 1400628624@qq.com
 * @LastEditTime: 2025-08-01 16:09:43
 * @FilePath: \Gitee实训笔记\day15\Homework\day15\test01\Bus.java
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
package day15.test01;

class Bus extends Automobile {
    private int seatCount;

    public Bus(String brand, String plateNumber, int seatCount) {
        super(brand, plateNumber);
        this.seatCount = seatCount;
    }

    @Override
    public int getRent(int days) {
        int dailyRent = seatCount <= 16 ? 400 : 600;
        return dailyRent * days;
    }
}

// 测试类
public class Test09_automobile {
    public static void main(String[] args) {
        Truck t = new Truck("北汽", "苏U2345", "中型");
        int rent = t.getRent(3);
        System.out.println(t.getBrand() + "\t" + t.getPlateNumber() + " 租金为: " + rent);
        // 输出 北汽 苏U2345 租金为: 1050

        Automobile b = new Bus("宇通", "苏A12345", 30);
        int busRent = b.getRent(10);
        System.out.println(b.getBrand() + "\t" + b.getPlateNumber() + " 租金为: " + busRent);
        // 输出 宇通 苏A12345 租金为: 6000
    }
}